package com.peach.mapper;

import com.peach.pojo.News;
import com.peach.pojo.NewsType;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NewsMapper {

    List<News> selectAllNewsNoConditions();

    List<News> selectAllNews(@Param("newsTypeId") Integer newsTypeId,
                             @Param("newsTitle") String newsTitle,
                             @Param("newsAuthor") String newsAuthor);
    Boolean updateOneNews(News news);
    Boolean deleteOneNews(Integer newsId);
    Boolean insertOneNews(News news);

    //根据标题类型查
    List<News> selectNewsByTypeId(Integer newsId);
    //根据标题类型查
    List<News> selectNewsByTypeIdReturnNews(Integer newsId);

    //根据文章ID查详情
    News selectOneNews(Integer newsId);

    List<NewsType> selectAllNewsTypes();
}
